package hqyj.example.itemservice.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import hqyj.example.itemservice.domain.Users;
import hqyj.example.itemservice.mapper.UsersMapper;
import hqyj.example.itemservice.service.UsersService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements UsersService {

    @Override
    public boolean login(String username, String password) {
        QueryWrapper<Users> queryWrapper = new QueryWrapper<Users>();
        queryWrapper.eq("username", username);
        queryWrapper.eq("password", password);
        List<Users> usersList = super.list(queryWrapper);
        if (usersList != null && usersList.size() > 0) {
            return true;
        }
        return false;
    }
}
